#pragma once

#include "workspace/IApplication.h"

interface IView;
class Application : public IApplication
{
public:
	BEGIN_DEFINE_CLASS(CLSID_Application)
		DEFINE_INTERFACE_ENTRY(IApplication)
	END_DEFINE_CLASS()

public:
	Application();
	virtual ~Application();

	virtual vresult Load();
	virtual void Unload();
	virtual IWorkspace* GetWorkspace() const;
	virtual IMainFrame* GetMainFrame() const;
	virtual IAddinManager* GetAddinManager() const;
	virtual IController* GetController() const;
	virtual IView* GetActiveView() const;
	virtual bool IsActive() const;

	void SetActiveView(IView* view) ;

private:
	IView* m_activeView;
	sys::ObjectPtr m_objWorkspace;
	sys::ObjectPtr m_objMainframe;
	sys::ObjectPtr m_objAddinManager;
	sys::ObjectPtr m_objController;
};
AUTO_REGISTER_CLASSMAP_ENTRY_singleton(Application)